class Episode(object):
    
    __NUMBER_LENGTH__ = 3
    DEFAULT_EPS_NAME = "Naruto Shippuuden"

    def __init__(self, name, number, container, extraNumber=None):
        self.name = name
        self.absoluteNumber = str(int(number)) #removing left zeros for episodes number less than 100
        self.number =  self.__parseNumber(number)
        self.extraNumber =  self.__parseNumber(extraNumber)
        self.completeNumber = self.number if (self.extraNumber is None) else self.number+self.extraNumber
        self.container = container
        self.season = "01"
        self.title = None
        self.rating = None
        self.aired = None
        self.plot = None
        self.director = None
        
    def __parseNumber(self, number):
        if(number is not None): 
            while len(number) < self.__NUMBER_LENGTH__:
                number = "0"+number
        return number
    
    def getFileName(self):
        return self.name+".S"+self.season+"E"+self.completeNumber  
    
    def __str__(self):
        return self.getFileName()+"."+self.container